//创建载具和乘员，并加入组
params ["_type", "_pos", "_group", ["_dynamic", true]];

private _veh = _type createVehicle _pos;

//随机迷彩
_veh call fn_randomMask;
_veh enableDynamicSimulation _dynamic;

//创建乘员
createVehicleCrew _veh;
private _crews = crew _veh; 
{
	[_x] call fn_initUnit;
	[_x] joinSilent _group;
}forEach _crews;

_group addVehicle _veh;
_veh engineOn true;
//_____________________________不被清理标记（暂时这样，只有巡逻队用）_____________________________
_veh setVariable["no_cleanup", true];


[_veh, _group]spawn
{
	//原地计时不动解卡
	params ["_veh", "_group"];
	private _driver = driver _veh;
	private _pos_pre = getPos _veh;
	while {alive _driver} do
	{
		sleep 60;
		if(_veh distanceSqr _pos_pre < 25) then
		{
			if(isNull (_veh call fn_getPlayerEyeMe)) then
			{
				_veh engineOn true;
				_veh setVehiclePosition [getPos _veh, [], 2, "NONE"];
			};
		};
		_pos_pre = getPos _veh;
	};
};
	
